<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Document</title>
  <style>
      .current {
          color: gold;
      }
  </style>
</head>
<body>
  <div id="app">
      <h2>11111</h2>
      <com-a>
          <div slot-scope="slotProps">
              {{slotProps.myprop}} ---- {{slotProps.myindex}}
          </div>
    </com-a>
  </div>


  <template id="tmp">
      <div>
          <h2>作用域插槽</h2>
      <ul>
          <li v-for='(item,index) in list'>
              <slot :myprop='item' :myindex='index'>{{item}}</slot>
            </li>
      </ul>
    </div>
  </template>

  <script src="./vue.js"></script>
  <script>
      Vue.component("comA",{
          data() {
              return {
                list:['apple','banana','melon']
              }
          },
          template:"#tmp"
      })

    var vm = new Vue({
      el:'#app',
      data:{
         
      },
      methods:{
      }
     });
  </script>
</body>
</html>
